package com.hnuit.service;

import com.hnuit.Utils.MybatisUtils;
import com.hnuit.dao.CoursesDao;
import com.hnuit.dao.EnrollmentsDao;

import com.hnuit.pojo.Courses;
import com.hnuit.pojo.Enrollments;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.io.IOException;
import java.util.List;

public class EnrollmentsDemo {
    @Test
    public void findAllEnrollments() throws IOException {
        SqlSession session= MybatisUtils.getSession();
        EnrollmentsDao dao=session.getMapper(EnrollmentsDao.class);
        List<Enrollments> all=dao.findAllEnrollments();
        System.out.println(all);
        session.close();
    }

}
